<h1>Pages</h1>

<?php
  //echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/images/icon_add.jpg') . 'add page', array('pages/create'));
  $this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    'ajaxUpdate'=>true,
    'columns'=>array(
      array(
        'header'=>'No.',
        'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
      ),
      'name_en',
      'description_en',
      /* array(
        'header'=>'Enable',
        'class'=>'CButtonColumn',
        'template'=>'{enable} {disable}',
        'buttons'=>array(
          'enable' => array(
            'imageUrl' => Yii::app()->request->baseUrl.'/images/icons/icon_enable.jpg',
            'visible'=>'$data->enable == true',
            'url'=>'Yii::app()->createUrl("pages/updateStatus", array("id"=>$data->id))',
            'click'=>'function(){if (confirm("Do you want to disable this?")){return true; }else { return false;}}',
          ),
          'disable' => array(
            'imageUrl' => Yii::app()->request->baseUrl.'/images/icons/icon_disable.jpg',
            'visible'=>'$data->enable == false',
            'url'=>'Yii::app()->createUrl("pages/updateStatus", array("id"=>$data->id))',
            'click'=>'function(){if (confirm("Do you want to enable this?")){return true; }else { return false;}}',
          )
        ),
      ), */
      array(
        'header'=>'Edit',
        'class'=>'CButtonColumn',
        'template'=>'{update}',
      ),
      /*array(
        'header'=>'Delete',
        'class'=>'CButtonColumn',
        'template'=>'{delete}',
        'buttons'=>array
        (
					'delete' => array
					(
						'visible'=>'$data->deleteable == true',
					),        	
        )
      ), */
    ),
  )); ?>
